package com.techwells.learningkites.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import com.techwells.learningkites.R;
import com.techwells.taco.base.CommonBaseActivity;

public class PayActivity extends CommonBaseActivity {
	
	private ListView lvPay;
	private List<Map<String, Object>> listPay;
	private SimpleAdapter adapter;
	private String[] payType = {"1个月","2个月","3个月","4个月"};
	private String[] payMoney = {"50元","140元","300元","500元"};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_pay);
		
		initTitleBar(R.string.pay, defaultLeftClickListener);
		initViews();
	}

	private void initViews() {
		lvPay = (ListView) findViewById(R.id.lv_pay);
		listPay = new ArrayList<Map<String,Object>>();
		for (int i = 0; i < payType.length; i++) {
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("name", payType[i]);
			map.put("money", payMoney[i]);
			listPay.add(map);
		}
		
		adapter = new SimpleAdapter(PayActivity.this, listPay, R.layout.item_paylist,
				new String[]{"name","money"}, new int[]{R.id.item_name,R.id.item_money});
		lvPay.setAdapter(adapter);
		
	}

}
